package com.jmgd.cjlx.controller;

import com.jmgd.cjlx.dao.SendOrderMapper;
import com.jmgd.cjlx.dto.TestDto;
import com.jmgd.cjlx.service.JmgdService;
import com.jmgd.cjlx.service.PosService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/Test")
public class TestController {
    @Autowired
    PosService posService;

    @Autowired
    SendOrderMapper sendOrderMapper;

    @Autowired
    JmgdService jmgdService;


    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String test() throws Exception {
        System.out.println("=============");
//        for(int i=0 ;i<testDto.getMoreNotifyObject().size();i++){
//            System.out.println(testDto.getMoreNotifyObject().get(i).getName());
//        }

        //posService.delOrder("2022-04-25","2022-04-25");
        //jmgdService.createExcelLx(null);
        //jmgdService.createExcelLx("");
       return "11";
    }

    @RequestMapping(value = "/2", method = RequestMethod.POST)
    public String queryBaseData2() throws Exception {
        System.out.println("111111");
        //posService.delOrder("2022-04-25","2022-04-25");
        return "11";
    }

    @RequestMapping(value = "/3", method = RequestMethod.POST)
    public String queryBaseData3(TestDto testDto) throws Exception {
        System.out.println(testDto.getTest());
        String oldUnicode = new String(testDto.getTest().getBytes( "UTF-8"), "UTF-8");
        System.out.println(oldUnicode );

        String gbkStr = new String(oldUnicode.getBytes("GBK"), "GBK");
        System.out.println(gbkStr);
        //posService.delOrder("2022-04-25","2022-04-25");
        return "11";
    }


    @RequestMapping(value = "/4", method = RequestMethod.POST)
    public String queryBaseData4(String test) throws Exception {
        System.out.println(test);
        //posService.delOrder("2022-04-25","2022-04-25");
        return "11";
    }
}
